using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace Ssb.ContentTypes
{
    public class MenuItem_Content
        : ContentType
    {
        public MenuItem_Content()
        {
            // nop
        }

        public MenuItem Build(Game game)
        {
            Initialize(game);

            MenuItem mi = new MenuItem(game);

            mi.activeTexture = cm.Load<Texture2D>(activeTexture);
            mi.itemTexture = cm.Load<Texture2D>(itemTexture);

            mi.coords = coords;

            try
            {
                mi.link = cm.Load<Menu_Content>(link).Build(game);
                mi.link.Parent = mi.owner;
            }
            catch (Exception)
            {
                mi.link = null;
            }

            return mi;            
        }

        public string activeTexture;
        public string itemTexture;

        public Vector2 coords;

        public string link;
        public string owner;
    }
}